import java.util.*;

public class Test {

    public static void main(String[]args){
        Scanner scan=new Scanner(System.in);
        String A=scan.nextLine();
        String B=scan.nextLine();
        if(A==null){
            return;
        }
        int k=0,v=0;
        int sum=0;
        for(int i=0;i<=A.length();i++){
            String pre=A.substring(k,v);
            String rear=A.substring(v,A.length());
            String indexStr=pre+B+rear;
            boolean flag=true;
            for(int start=0,end=indexStr.length()-1;start<end;start++,end--){
                if(indexStr.charAt(start)!=indexStr.charAt(end)){
                    flag=false;
                    break;
                }
            }
            if(flag){
                sum++;
            }
            v++;
        }

        System.out.println(sum);
    }

        public static void main5(String[]args){
            Scanner scan=new Scanner(System.in);
            int M=scan.nextInt();
            int N=scan.nextInt();
            StringBuffer target=new StringBuffer();
            Map<Integer,Character>map=new HashMap<>();
            map.put(10,'A');
            map.put(11,'B');
            map.put(12,'C');
            map.put(13,'D');
            map.put(14,'E');
            map.put(15,'F');


            boolean flag=false;
            if(M<0){
                flag=true;
            }
            while(M!=0){
                int index=M%N;
                M=M/N;
                if(map.get(index)==null){
                    target.append(index);
                }else{
                    target.append(map.get(index));
                }

            }
            target.reverse();
            if(flag){
                target.append('-');
            }
            System.out.println(target.toString());
        }



    public static void main2(String[] args) {
        int[]arr={1,1,1,2,3,3,3,3,4,4};
        System.out.println(MoreThanHalfNum_Solution(arr));
    }
    public static int MoreThanHalfNum_Solution (int[] numbers) {
        Map<Integer,Integer>map=new HashMap<>();
        for (int i = 0; i < numbers.length; i++) {
            //检查元素是否为第一次添加key
            if(map.containsKey(numbers[i])){
                //已添加元素
                int forValue=map.get(numbers[i]);
                map.put(numbers[i],forValue+1);
            }else{
                //第一次添加元素
                map.put(numbers[i],1 );
            }
        }


        Collection<Integer> listValues=map.values();
        int maxValue=Collections.max(listValues);//最大的value值
        int target=0;
        for (Map.Entry<Integer,Integer> entry:map.entrySet()) {
            if(entry.getValue()==maxValue){
                target= entry.getKey();
            }
        }
        return target;
    }

    public static void main3(String[] args) {
        Map<String, Integer> map = new HashMap<>();
        map.put("李1", 1);
        map.put("李2", 2);
        map.put("李3", 3);
        map.put("李4", 4);
        map.put("李5", 5);
        map.put("李1",10);
        System.out.println(map.get("lk"));
//        System.out.println(map.get("李5"));
//        System.out.println(map.remove("李5",5));
//        System.out.println(map.get("李5"));
//        System.out.println(map.getOrDefault("ll", 66));
//        Collection<Integer>list=new LinkedList<>();
//        list=map.values();
//        System.out.println(list);
//        System.out//.println(map.containsKey("李1"));
//        System.out.println(map.containsKey("李11"));
//        System.out.println(map.containsValue(2));
//        System.out.println(map.containsValue(22));
        //Set<String>keySet=map.keySet();

        //System.out.println(entry);
        //System.out.println(keySet);

//        Set<Map.Entry<String, Integer>> entry = map.entrySet();
//        Iterator iterator = entry.iterator();
////        while(iterator.hasNext()){
////            System.out.println(iterator.next());
////        }
//        for (Map.Entry<String, Integer> entry1 : entry) {
//            System.out.println("key:" + entry1.getKey() + " value:" + entry1.getValue());
//        }
//        List<String> list = new LinkedList<>();
//        List<String> list1 = new ArrayList();

        // list1.
//list.remove(4);
//list.get(4);
        // }


//    public static void main5(String[] args) {
//        //使用Map和Set接口中的常用方法
//        Map<String,Integer> map=new TreeMap();
//        Set<String> set=new TreeSet<>();
//        map.put("李1",1);
//        map.put("李2",2);
//        map.put("李3",3);
//        map.put("李5",5);
//        map.put("李4",4);
//        //System.out.println(map);
//        int value=map.get("李4");
//        System.out.println(value);
//
//        int value2= map.getOrDefault("王1",-1);
//        System.out.println(value2);
//
//        map.remove("李5");
//        System.out.println(map);
//
//        set=map.keySet();
//        System.out.println(set);
//
//        Collection<Integer> val= new ArrayList<>();
//        val=map.values();
//        System.out.println(val);
//        //Collections
////        Set<Map.Entry<String,Integer>> classN=map.entrySet();
////        System.out.println("jj"+classN);
////
////        System.out.println(map.containsKey("李3"));
////        System.out.println(map.containsValue(2));
////        //Object[]arr=set.iterator();
////        Iterator iterator=set.iterator();
////        while(iterator.hasNext()){
////            System.out.println(iterator.next());
////        }
//
////        for (Map.Entry<String,Integer> i:classN) {
////            System.out.println(i.getKey()+" "+i.getValue());
////        }
//
//    }

    }
}